package recursion;

/**
 * @Author: LDeng
 * @Date: 2021-04-13 9:05
 */
public class ClimbStairs {

    //f(n)=f(n-1)+f(n-2)
    //初始条件 f(1)=1, f(2)=2
    int climbStairs(int n){
        if(n<=2) return n;
        return climbStairs(n-1)+climbStairs(n-2);
    }

}
